<template>
<div>
    <button size="default" type="default" @click="utilopen">utilopen</button>

    <button size="default" type="default" @click="layopen">layopen</button>

    <uv-button type="primary" text="打开用户对话框" @click="openUser"></uv-button>
    <!--
    <v-md-editor v-model="text" height="400px"></v-md-editor>
    -->

    <uv-button type="primary" text="自定义对话框" @click="openCustomDialog"></uv-button>


</div>
</template>

<script>

import Util from "@/js/Util.js"

import DemoDialog from "./DemoDialog";
import Dialog from "@/js/Dialog";



export default {
  name: "demo",
    data(){
      return {
          text:"# 标题",
          form:{
              A:"",
              B:"",
              C:""

          }
      }
    },
    computed:{
      show(){
          return ()=>{
              console.log("show");
              return true;
          }
      }
    },
    methods:{
        show(){

                console.log("show");
                return true;

        },
        utilopen(){
            let conf={
                component:DemoDialog,
                //对话框选项
                dialogOptions:{
                    title:'我的标题',
                    okText:'确定'
                },
                data:{name:"util"},
                curVm:this,
            }
            Util.open(conf,(obj)=>{
            })
        },
        layopen(){
        },
        openUser(){
            let conf={
                data:{
                    value:[{userId:"",fullName:""}],
                    single:false,
                    dimIds:"1",
                    tenantId:"1",
                    //显示维度
                    organization:true
                },
                curVm:this
            };
            Dialog.openUserDialog(conf,(obj)=>{
                console.info("选择数据!");
                console.info(obj);

            })
        },
        openCustomDialog(){
            Dialog.openListDialog({
                data:{
                    alias:"customer_dialog",
                    single:false,
                    initData:{
                        keyField:"ID_",
                        selected:["1783497147321196546","1783497365437587457"]
                    }
                },
                curVm:this,
            },function (data){
                console.info(data);
            })
        }
    }
}
</script>

<style scoped>

</style>
